//
//  SectionTableViewCell.swift
//  DriverSchoolAPP
//
//  Created by Logel on 2017/5/11.
//  Copyright © 2017年 Logel. All rights reserved.
//

import UIKit

class SectionTableViewCell: UITableViewCell {
    @IBOutlet weak var okBtn: UIButton!
    @IBOutlet weak var nameLbl: UILabel!
    @IBOutlet weak var timeLbl: UILabel!

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        okBtn.layer.cornerRadius = 5
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    var learn:Learn!{
        didSet{
            nameLbl.text = learn.className
            timeLbl.text = "通过时间:\(learn.createTime)"
            switch learn.type {
            case "已通过":
                okBtn.setTitle("已通过", for: .normal)
                okBtn.backgroundColor = KP_MAIN_BLUE
            default:
                okBtn.setTitle("未通过", for: .normal)
                okBtn.backgroundColor = UIColor.lightGray
            }
        }
    }

}
